#include "prateleira1bruno.h"

#include <GL/glu.h>
#include "gllib/Objects.h"
void Prateleira1Bruno::draw()
{
    glEnable(GL_COLOR_MATERIAL);
    glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

    float mat_specular[] = {0.7, 0.7, 0.7, 1.0};
    float mat_diffuse[] = {1.0, 1.0, 1.0, 0.3};
    float shininess = 20;

    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialf(GL_FRONT, GL_SHININESS, shininess);
    glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);

    glPushMatrix();
    desenharPrateleira();

    glPopMatrix();

    glDisable(GL_COLOR_MATERIAL);
}

void Prateleira1Bruno::desenharPrateleira(){
    glColor3f(0.7,0.6,0.05);
    glPushMatrix();
    gllibCylinder(0.1,2,100);

    glTranslatef(2,0,0);
    gllibCylinder(0.1,2,100);

    glTranslatef(0,0,-2);
    gllibCylinder(0.1,2,100);

    glTranslatef(-2,0,0);
    gllibCylinder(0.1,2,100);

    glColor4f(0.4,0.4,0.4,0.5);
    glTranslatef(1,1,1);
    glScalef(2,0.05,2);
    gllibCube(1.1);

    glTranslatef(0,-20,0);
    gllibCube(1.1);

    glPopMatrix();
}
